package com.avob.openadr.server.oadr20b.vtn.models.venreport.capability;

import java.util.List;

import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

import com.avob.openadr.model.oadr20b.ei.ReadingTypeEnumeratedType;
import com.avob.openadr.model.oadr20b.ei.ReportEnumeratedType;
import com.avob.openadr.server.common.vtn.models.ItemBase;
import com.avob.openadr.server.common.vtn.models.Target;

/**
 * @author bzanni
 *
 */
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class ReportCapabilityDescription {

	/**
	 * Autogenerated unique id
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.TABLE)
	private Long id;

	private String rid;

	@Enumerated(EnumType.STRING)
	private ReportEnumeratedType reportType;

	@Enumerated(EnumType.STRING)
	private ReadingTypeEnumeratedType readingType;

	private SamplingRate samplingRate;

	private ItemBase itemBase;

	@ElementCollection
	@LazyCollection(LazyCollectionOption.FALSE)
	private List<Target> eiDatasource;

	@ElementCollection
	@LazyCollection(LazyCollectionOption.FALSE)
	private List<Target> eiSubject;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getRid() {
		return rid;
	}

	public void setRid(String rid) {
		this.rid = rid;
	}

	public ReportEnumeratedType getReportType() {
		return reportType;
	}

	public void setReportType(ReportEnumeratedType reportType) {
		this.reportType = reportType;
	}

	public ReadingTypeEnumeratedType getReadingType() {
		return readingType;
	}

	public void setReadingType(ReadingTypeEnumeratedType readingType) {
		this.readingType = readingType;
	}

	public ItemBase getItemBase() {
		return itemBase;
	}

	public void setItemBase(ItemBase itemBase) {
		this.itemBase = itemBase;
	}

	public List<Target> getEiDatasource() {
		return eiDatasource;
	}

	public void setEiDatasource(List<Target> eiDatasource) {
		this.eiDatasource = eiDatasource;
	}

	public List<Target> getEiSubject() {
		return eiSubject;
	}

	public void setEiSubject(List<Target> eiSubject) {
		this.eiSubject = eiSubject;
	}

	public SamplingRate getSamplingRate() {
		return samplingRate;
	}

	public void setSamplingRate(SamplingRate samplingRate) {
		this.samplingRate = samplingRate;
	}
}
